package JavaExercise;

import java.util.Random;
import java.util.Scanner;

public class Page15_1 {
    static Random rand = new Random();
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        double r=0.0;
        int i;
        for (i=0;r<0.999;i++){
            r = rand.nextDouble();
        }
        System.out.println(i+"次"+"数为"+r);
    }

}
